<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body style="background:  url('img/040705.jpg') no-repeat  ; background-size:1278px 670px">
	<h2 style="color: white;">重置密码</h2>
	
	<form action="doLogin.action?methodName=toLogin" method="post" >
		<table align="center" width="40%">
			<tr>
				<th align="left" style="color: white;">密码：</th>
				<td align="left">
					<input type="password" name="password" value="${users.userId }"/><b><span id="resultPassword" style="color: red;"></span></b>
				</td>
			</tr>
			<tr>
				<th align="left" style="color: white;">确认密码：</th>
				<td align="left">
					<input type="password" name="againPassword" /><b><span id="resultAgainPassword" style="color: red;"></span></b>
				</td>
			</tr>
			<%-- <tr>
				<th class="textright">电话号码：</th>
				<td class="textleft">
					<input type="text" name="tel" />
				</td>
				<td id="resultTel"></td>
			</tr>
			<tr>
				<th class="textright">昵称：</th>
				<td class="textleft">
					<input type="text" name="nickName" value="${users.nickName}"/>
				</td>
				<td id="resultNickName"></td>
			</tr> --%>
			<tr>
				<td colspan="3" style="margin-left: 40px"><br />
					<input type="submit" value="重置密码" style="margin-right: 30px"/>
					<!-- <input type="button" value="返回" onclick="window.location='doLogin.action?methodName=toLogin'" /> -->
				</td>
			</tr>
		</table>
	</form>

	</center>
	
</body>

	<link rel="stylesheet" href="${pageContext.request.contextPath }/css/editTablestyles.css" />
	<script type="text/javascript" src="${pageContext.request.contextPath }/webjars/jquery/1.12.4/jquery.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/listTable.js"></script>
	<script type="text/javascript">
		$("select[name='userRoles']").val("${users.userRoles}");
	
	</script>
	
	
	
	
	
	
	
 	<script type="text/javascript">
		$(function() {
			$("form").click(function() {
				var password = $("input[name='password']").val();
				var againPassword = $("input[name='againPassword']").val();

				if(password == "") {
					$("#resultPassword").text("请输入密码！");
					return false;
				}
				if(password.length<4||password.length>20) {
					$("#resultPassword").text("密码长度必须是4至20之间！");
					return false;
				}else{
					$("#resultPassword").text("√");
				}
				
				
				
				if(againPassword == "") {
					$("#resultAgainPassword").text("确认密码不能为空！");
					return false;
				}else if(againPassword.length<4||againPassword.length>20) {
					$("#resultAgainPassword").text("确认密码长度必须是4至20之间！");
					return false;
				}else if(againPassword != password) {
					$("#resultAgainPassword").text("两次密码不一致！");
					return false;
				}else{
					$("#resultAgainPassword").text("√");
				}
				
				
				
			});
		});
	
	</script> 

</html>